<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html; charset=utf-8" import="com.*" import="com.util.Component" %>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	    <title>口头挂失</title>
	    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	    
	    <script src="${pageContext.request.contextPath }/scripts/boot.js" type="text/javascript"></script>
	    <script src="${pageContext.request.contextPath }/scripts/LodopFuncs.js" type="text/javascript"></script> 

  </head>
  
  <body onload="bklx()">
 <fieldset style="border:solid 1px #aaa;padding:3px;">
 <legend>口头挂失</legend>
   <form id="form1" method="post">
 	<!-- ============================== 第一部分 查询条件================================================= -->
  	 <!--  <fieldset style="border:solid 1px #aaa;padding:3px;height:25px;width:100%;height: 100%"> -->
	  	 <div style="padding-bottom:5px;padding-top:10px;align:center;">
	  		<table style="table-layout:fixed;" cellpadding="5">
	  			<tr>
	  			    <td style="width:15%;text-align:right;">变更类型:</td>
	  				<td style="width:20%;text-align:left;"><input id="aaz514" name="aaz514" inputStyle="background:rgb(241,241,243)" readonly="readonly" value="0" class="mini-combobox" emptyText="请选择..." data="[{'id': '0', 'text': '口头挂失'}]" style="width:100%;" /></td>
	  				<td style="width:15%;text-align:right;">社会保障卡号:</td>
	  				<td style="width:20%;text-align:left;"><input id="aac001" onenter="onKeyEnter" vtype="int;minLength:10" maxlength="10"  name="aac001" required="true" class="mini-textbox" emptyText="请输入社保卡号" style="width:100%;"/></td>		  				
	  				<td style="width:15%;"></td>
	  				<td style="width:15%;"></td>
	  			</tr>
	  		</table>
	  	 </div>
	  
  	 <!-- ============================== 第二部分 劳动保障号之类=========================================== -->	
	  
	  <hr />
	     <div style="width:100%;height:100%;" >
		      <table style="width:100%;" cellpadding="5" >
		     	<tr style="width:100%;">
		     		<td style="width:10%;text-align:right;white-space:nowrap;">劳动保障证号:</td>
		     		<td style="width:10%;"><input id="aab001" name="aab001" class="mini-textbox" inputStyle="background:rgb(241,241,243)" style="width:100%" allowInput="false"/></td>
		     		<td style="width:10%;text-align:right;white-space:nowrap;">单位名称:</td>
		     		<td colspan="3" style="width:30%;"><input id="aab004" name="aab004" class="mini-textbox" inputStyle="background:rgb(241,241,243)" style="width:100%" allowInput="false"/></td>
		     	  	<td rowspan="8" style="width:40%;white-space:nowrap;">
		     	  	<div id="pic" align="center" style="height:100%;background-color:rgb(241,241,243);">
		     	  	<img src="" id="img0" style="height:200px;width:150px"/></div></td>
		     	</tr>
		     	
		     	<tr style="width:100%;">
		     		<td style="width:10%;text-align:right;white-space:nowrap;">姓名:</td>
		     		<td style="width:10%;"><input id="aac003" name="aac003" class="mini-textbox" inputStyle="background:rgb(241,241,243)" style="width:100%" allowInput="false"/></td>
		     		<td style="width:10%;text-align:right;white-space:nowrap;">证件号:</td>
		     		<td colspan="3" style="width:30%;"><input id="aac002" name="aac002" class="mini-textbox" inputStyle="background:rgb(241,241,243)" style="width:100%" allowInput="false" /></td>
		     	</tr>
		     	
		     	<tr style="width:100%;">
		     		<td style="width:10%;text-align:right;white-space:nowrap;">民族:</td>
		     		<td style="width:10%;text-align:left;white-space:nowrap;"><input id="aac005" name="aac005" class="mini-combobox" inputStyle="background:rgb(241,241,243)" style="width:100%" allowInput="false"
		     		url="${pageContext.request.contextPath }/ktgs.do?method=getaac005&lx=AAC005" valueField="aaa102" textField="aaa103" readonly="readonly"/></td>
		     		<td style="width:10%;text-align:right;white-space:nowrap;">性别:</td>
		     		<td style="width:10%;text-align:left;white-space:nowrap;"><input id="aac004" name="aac004" class="mini-combobox" inputStyle="background:rgb(241,241,243)" style="width:100%" allowInput="false"
		     		url="${pageContext.request.contextPath }/ktgs.do?method=getaac004&lx=AAC004" valueField="aaa102" textField="aaa103" readonly="readonly"/></td>
		     		
		     		<td style="width:5%;text-align:right;white-space:nowrap;">出生日期:</td>
		     		<td style="width:15%;text-align:left;white-space:nowrap;"><input id="aac006" name="aac006" valueType="String" class="mini-datepicker" inputStyle="background:rgb(241,241,243)" style="width:100%" allowInput="false" readonly="readonly" /></td>
		     		
		     	</tr>
		     	<!--  
		     	<tr style="width:100%;">
		     		<td style="width:15%;text-align:right;white-space:nowrap;">家庭地址:</td>
		     		<td colspan="5" style="width:45%;text-align:left;white-space:nowrap;"><input id="aac046" name="aac046" class="mini-textbox" inputStyle="background:rgb(241,241,243)" style="width:100%" allowInput="false"/>
		     		</td>
		     		
		     	</tr>
		     	<tr style="width:100%;">
		     		<td style="width:15%;text-align:right;white-space:nowrap;">户口地址:</td>
		     		<td colspan="5" style="width:45%;text-align:left;white-space:nowrap;"><input id="aac010" name="aac010" class="mini-textbox" inputStyle="background:rgb(241,241,243)" style="width:100%" allowInput="false"/>
		     		</td>
		     	</tr>
		     	-->
		     	<tr style="width:100%;">
		     		<td style="width:10%;text-align:right;white-space:nowrap;">银行:</td>
		     		<td style="width:15%;text-align:left;white-space:nowrap;"><input id="aae008" name="aae008" class="mini-combobox" inputStyle="background:rgb(241,241,243)" style="width:100%" 
		     		url="${pageContext.request.contextPath }/ktgs.do?method=getyinhang&sj=bank" readonly="readonly" textField="aaa103" valueField="aaa102" allowInput="false"/></td>
		     		<td style="width:10%;text-align:right;white-space:nowrap;">银行卡号:</td>
		     		<td colspan="3" style="width:25%;text-align:left;white-space:nowrap;"><input id="aae009" name="aae009" class="mini-textbox"  inputStyle="background:rgb(241,241,243)" style="width:100%" allowInput="false"/></td>
		     		
		     	</tr>
		     	<tr style="width:100%;">
		     		<td style="width:10%;text-align:right;white-space:nowrap;">操作人:</td>
		     		<td style="width:10%;text-align:left;white-space:nowrap;"><input id="aae011" name="aae011" class="mini-textbox" inputStyle="background:rgb(241,241,243)" style="width:100%" allowInput="false"/></td>
		     		<td style="width:10%;white-space:nowrap;"></td>
		     		<td style="width:5%;white-space:nowrap;"></td>
		     		<td style="width:10%;text-align:right;white-space:nowrap;">操作日期:</td>
		     		<td style="width:15%;text-align:left;white-space:nowrap;"><input id="aae036" value="<%=Component.systime()%>"  name="aae036" readonly="true"  valueType="String" class="mini-datepicker" inputStyle="background:rgb(241,241,243)" style="width:100%" allowInput="false"/></td>
		     		
		     	</tr>
		     	<tr style="width:100%;">
		     		<td style="width:10%;text-align:right;white-space:nowrap;">备注:</td>
		     		<td style="width:10%;text-align:right;white-space:nowrap;" colspan="3"><input id="aaz523" name="aaz523" class="mini-textbox" maxlength="50" emptyText="请输入备注信息" style="width:100%;"/></td>
		     	
		     		<td style="width:10%;text-align:right;white-space:nowrap;">联系电话:</td>
		     		<td style="width:20%;text-align:left;white-space:nowrap;"><input id="azf044" name="azf044" required="true" class="mini-textbox"  vtype="int" maxlength="11"  emptyText="请输入电话" style="width:100%;" /></td>		     		
		     	</tr>		     	
		     </table>
	     </div>
	      </form> 
	      </fieldset>

  	
 	 <!-- ============================== 第三部分 按钮================================================== -->
 	 <br/>
	    <div style="text-align:center;padding:10px;">
	    
	    	
	    		<a class="mini-button" onclick="Preview1"   id="print1" iconCls="icon-print" enabled="false" style="width:90px;margin-right:20px;">全部打印</a>
	    		<a class="mini-button" onclick="Preview2"   id="print2" iconCls="icon-print" enabled="false" style="width:100px;margin-right:20px;white-space:nowrap;">办理内容打印</a>
	    		
			     <a class="mini-button" iconCls="icon-ok" id="onoks" onclick="onOk" enabled="false"  style="width:60px;margin-right:20px;">确认</a>
			     <a class="mini-button" iconCls="icon-remove" onclick="onReset"   style="width:60px;margin-right:20px;">重置</a>
	    		
	    	
	    </div> 
	
   <script type="text/javascript">
     mini.parse();
    var form = new mini.Form("form1");
      function bklx() {
       mini.getbyName("aaz514").setValue("0");
       mini.getbyName("aaz514").setReadonly(true);  //变更类型
       mini.getbyName("aac005").setReadonly(true);  //民族
       mini.getbyName("aac004").setReadonly(true);  //性别
       mini.getbyName("aae009").setReadonly(true);  //银行卡
    }
      /*
    window.onload = function() {
			var t = mini.getbyName("aae036");
			mini.getbyName("aae036").setValue(today);
		};
    */
    function onKeyEnter()
        {
          var aac001 = mini.getbyName("aac001").getValue().trim(); 
          var aaz514 = mini.getbyName("aaz514").getValue().trim();  
          if(aaz514=="")   
          {
            mini.alert("请选择挂失类型！");
            return;
          }  else {               
           $.ajax({               
                    url: "/sbk/ktgs.do?method=checkdata",                 
                    data:{aac001:aac001,aaz514:aaz514},
                    success: function (text) {                                                                                
                     if("0"==text)
                     {                    
                       search();
                       $("#img0").attr("src", "${pageContext.request.contextPath}/Picture/"+aac001+".JPG") ;
                     }
                     else
                     {
                       mini.alert(text); 
                       form.clear(); 
                       mini.getbyName("aae036").setValue('<%=Component.systime()%>');
                       bklx();                   
                     }
                  
                                     
                    }
                });   
          }
        }
    
      function search()
      {
         var aac001 = mini.getbyName("aac001").getValue().trim(); 
          $.ajax({               
                    url: "/sbk/ktgs.do?method=getdata",                 
                    data:{aac001:aac001},
                    success: function (text) {                                        
                    var o = mini.decode(text);
                    mini.getbyName("aab001").setValue(o.aab001);
                    mini.getbyName("aab004").setValue(o.aab004);
                    mini.getbyName("aac003").setValue(o.aac003);
                    mini.getbyName("aac002").setValue(o.aac002);
                 //   mini.getbyName("aac046").setValue(o.aac046);
                 //   mini.getbyName("aac010").setValue(o.aac010);
                    mini.getbyName("aae008").setValue(o.aae008);
                    mini.getbyName("aae009").setValue(o.aae009);
                    mini.getbyName("aae011").setValue(o.aae011); 
                    mini.getbyName("aac004").setValue(o.aac004);
                    mini.getbyName("aac006").setValue(o.aac006);
                    mini.getbyName("aac005").setValue(o.aac005);  
                    mini.get("aac001").setEnabled(false);
                    mini.get("onoks").setEnabled(true);
                    }
                });  
      }
      
      function onOk()
      {
        SaveData();
      }
      
      function SaveData() {          
			var o = form.getData();				
			form.validate();
			if (form.isValid() == false)
			return;
			if(form.isValid()==true){
      	    mini.mask({el: document.body,cls: 'mini-mask-loading',html: '登记中...'});
 
			var json = mini.encode([o]);		
			$.ajax({
				url : "/sbk/ktgs.do?method=savedata",
				type : 'post',
				data : {
					data : json
				},
				cache : false,
				success : function(text) {
				    mini.unmask();  
				    if("0"== text)
				    {
				     mini.alert("登记成功");
				    labelModel();
				     mini.get("onoks").setEnabled(false);
				     mini.get("print1").setEnabled(true);
				     mini.get("print2").setEnabled(true);
				    }
				    else
				    {
				      alert("登记失败:"+text);	
				      onReset();			      
				    }					   			
						   	
				},
				error : function(jqXHR, textStatus, errorThrown) {
					mini.alert(jqXHR.responseText);					
				}
			});
     	    }
		}	
		
    var LODOP; //声明为全局变量 
	function Preview1() {		
	CreateTwoFormPage1();
	  	LODOP.PREVIEW();		
	};
	
	function CreateTwoFormPage1(){
	LODOP=getLodop();
var aac001 = mini.getbyName("aac001").getValue().trim(); 
var aac003 = mini.getbyName("aac003").getValue().trim(); 
var aac004_name = mini.getbyName("aac004").getText().trim(); 
var aac002 = mini.getbyName("aac002").getValue().trim(); 
var aac006 = mini.getbyName("aac006").getValue().trim(); 
var aac005 = mini.getbyName("aac005").getText().trim();
var aaz523 = mini.getbyName("aaz523").getValue().trim();
var aae036 = mini.getbyName("aae036").getValue().trim();
LODOP.PRINT_INIT("");
LODOP.ADD_PRINT_TEXT(60,200,100,20,aac001);
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
LODOP.ADD_PRINT_TEXT(60,470,100,20,aac003);
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
LODOP.ADD_PRINT_TEXT(60,643,59,20,aac004_name);
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
LODOP.ADD_PRINT_TEXT(104,158,179,20,aac002);
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
LODOP.ADD_PRINT_TEXT(104,473,95,25,aac006);
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
LODOP.ADD_PRINT_TEXT(104,643,60,20,aac005);
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
LODOP.ADD_PRINT_TEXT(202,138,494,95,"社保卡挂失");
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
LODOP.ADD_PRINT_TEXT(320,138,494,40,aaz523);
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
LODOP.ADD_PRINT_TEXT(376,138,300,23,"南京市人力资源与社会保障局");
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
LODOP.ADD_PRINT_TEXT(376,535,100,20,aae036);
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);

}        
   
    
	function Preview2() {		
	CreateTwoFormPage2();
	  	LODOP.PREVIEW();		
	};
	
	function CreateTwoFormPage2(){
	LODOP=getLodop();

LODOP.PRINT_INIT("");
LODOP.ADD_PRINT_TEXT(202,138,494,95,"社保卡挂失");
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
LODOP.ADD_PRINT_TEXT(320,138,494,40,aaz523);
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
LODOP.ADD_PRINT_TEXT(376,138,300,23,"南京市人力资源与社会保障局");
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
LODOP.ADD_PRINT_TEXT(376,535,100,20,aae036);
LODOP.SET_PRINT_STYLEA(0,"FontSize",11);

}   
      
       function labelModel() {
            var fields = form.getFields();                
            for (var i = 0, l = fields.length; i < l; i++) {
                var c = fields[i];
                if (c.setReadOnly) c.setReadOnly(true);     //只读
                if (c.setIsValid) c.setIsValid(true);      //去除错误提示
                if (c.addCls) c.addCls("asLabel");          //增加asLabel外观
            }
        }
        
         function inputModel() {
            var fields = form.getFields();
            for (var i = 0, l = fields.length; i < l; i++) {
                var c = fields[i];
                if (c.setReadOnly) c.setReadOnly(false);
                if (c.removeCls) c.removeCls("asLabel");
            }
            mini.repaint(document.body);
        }
    
      function onReset(e) {
    	  
			form.clear();
			mini.getbyName("aae036").setValue('<%=Component.systime()%>');
			mini.getbyName("aaz514").setValue("0");
			mini.get("print1").setEnabled(false);
		    mini.get("print2").setEnabled(false);
		    mini.get("aac001").setEnabled(true);
		    mini.get("onoks").setEnabled(false);
		    
		    mini.getbyName("form").setReadonly(true);
			$("#img0").attr("src", "");	
			bklx();
		}	
  </script>
  </body>

</html>
